use Net::SFTP::Foreign;

my $host = "8.131.73.2";

my %args = (
    user => "grpdata",
    password => "RhZth5tKpTtKL7xf",
    port => 10022,
);

my $path = "/grpdata";

my $sftp = Net::SFTP::Foreign->new($host, %args);
$sftp->die_on_error("Unable to establish SFTP connection");
 
$sftp->setcwd($path) or die "unable to change cwd: " . $sftp->error;

my $ls = $sftp->ls($path) or die "unable to retrieve directory: ".$sftp->error;;
# print "$_->{filename}\n" for (@$ls);
for my $file (@$ls) {
    print $file->{longname}."\n";
}


# $sftp->get("foo", "bar") or die "get failed: " . $sftp->error;
 
# $sftp->put("bar", "baz") or die "put failed: " . $sftp->error;


# sftp  -oPort=10022 grpdata@8.131.73.2  RhZth5tKpTtKL7xf